
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class FilterAdmin implements Filter {

    FilterConfig fc;

    @Override
    public void init(FilterConfig fc) throws ServletException {
        this.fc = fc;
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain fc) throws IOException, ServletException {

        String username = request.getParameter("username");
        String password = request.getParameter("password");

        if ((username.equals("admin")) && (password.equals("admin"))) {

        } else {

        }

        fc.doFilter(request, response);
    }

    @Override
    public void destroy() {
    }
}
